package com.wno704.system.config;

import com.wno704.intf.service.DbSourceService;
import com.wno704.intf.service.IntfScriptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @ClassName WnoQuartzRunner
 * @Description TODO
 * @Author wno704
 * @Date 2023/04/22 20:03
 * @Version 1.0
 */
@Component
@Slf4j
public class WnoQuartzRunner  implements CommandLineRunner {

    @Autowired
    private DbSourceService dbSourceService;

    @Autowired
    private IntfScriptService intfScriptService;

    @Override
    public void run(String... args) throws Exception {
        initDataSource();
    }

    private void initDataSource() {
        dbSourceService.init();
        intfScriptService.init();
    }
}
